package com.yohann.designPattern.interpreter;

import java.util.HashMap;

/**
 * <p>
 * 减肥表达式
 * </p>
 *
 * @author Yohann
 * @since 2021/2/13 16:34
 */
public class SubExpression extends SymbolExpression {
    public SubExpression(Expression left, Expression right) {
        super(left, right);
    }

    @Override
    public int interpreter(HashMap<String, Integer> var) {
        return super.getLeft().interpreter(var) - super.getRight().interpreter(var);
    }
}